#{extends 'CRUD/layout.html' /}
#{set title:messages.get('objects.medicationdetails') /}

<div id="crudList" class="${type.name}">

    <h2 id="crudListTitle">&{'objects.medicationdetails'}</h2>

    <div id="crudListSearch">
        #{crud.search /}
    </div>

    <div id="crudListTable">
        #{crud.table fields:['medicationDetailName', 'medication']}
        	#{crud.custom 'medicationDetailName'}
           	  	<span class="hiddenLinks">@{MedicationDetails.show(object.medicationDetailId)}</span>
		      	${object.medicationDetailName}
		   	#{/crud.custom}
		   	#{crud.custom 'medication'}
		   		#{if object.medication != null}
	           	  	<span class="hiddenLinks">@{Medications.show(object.medication.medicationId)}</span>
			      	${object.medication.medicationName}
		      	#{/if}
		   	#{/crud.custom}
        #{/crud.table}
    </div>

    <div id="crudListPagination">
        &{'total', models.MedicationDetail.count()}
        #{pagination /}
    </div>

    <p id="crudListAdd">
        <a href="@{blank()}">&{'medicationDetail.add'}</a>
    </p>

</div>
